package com.self.admin.feign;

import com.self.common.dto.JwtTokenDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @version v1.0
 * @ClassName: Auth2FeignClient
 * @Description:
 * @Author: Mac
 * @Date: 2022/6/2 22:39
 */
@FeignClient("auth-server")
public interface Auth2FeignClient {

    @PostMapping("/oauth/token")
    ResponseEntity<JwtTokenDto> getToken(@RequestParam("grant_type") String grantType,
                                         @RequestParam("username") String username,
                                         @RequestParam("password") String password,
                                         @RequestParam("login_type") String login_type,
                                         @RequestHeader(HttpHeaders.AUTHORIZATION) String basicToken
                                         );
}
